import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/layout',
    component: () => import('../views/layout/layout.vue'),
    redirect: '/layout/home',
    children: [
      {
        path: 'home',
        component: () => import('../views/home/home.vue')
      },
      {
        path: 'record',
        component: () => import('../views/record/record.vue')
      },
      {
        path: 'chat',
        component: () => import('../views/chat/chat.vue')
      },
      {
        path: 'my',
        component: () => import('../views/my/my.vue')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('../views/login/login.vue')
  },
  {
    path: '/chat/lover',
    component: () => import('../views/chat/components/lover.vue')
  },
  {
    path: '/chat/gpt',
    component: () => import('../views/chat/components/gpt.vue')
  },
  {
    path: '/dynamic',
    component: () => import('../views/my/components/dynamic.vue')
  },
  {
    path: '/dynamic/add',
    component: () => import('../views/my/components/dynamicMake.vue')
  },
  {
    path: '/aspiration',
    component: () => import('../views/my/components/aspiration.vue')
  },
  {
    path: '/register',
    component: () => import('../views/login/register.vue')
  },
  {
    path: '/search',
    component: () => import('../views/search/search.vue')
  },
  {
    path: '/article/:articleId',
    component: () => import('../views/article/article.vue')
  },
  {
    path: '/user',
    component: () => import('../views/userfile/userfile.vue')
  },
  {
    path: '/puzzle',
    component: () => import('../views/record/components/puzzle.vue')
  },
  {
    path: '/match',
    component: () => import('../views/record/components/nameMatch.vue')
  },
  {
    path: '/luck',
    component: () => import('../views/record/components/constellation.vue')
  },
  {
    path: '/character',
    component: () => import('../views/record/components/character.vue')
  },
  {
    path: '/memories',
    component: () => import('../views/my/components/memories.vue')
  },
  {
    path: '/calender',
    component: () => import('../views/my/components/calender.vue')
  },
  {
    path: '/safe',
    component: () => import('../views/my/components/safe.vue')
  },
  {
    path: '/opinion',
    component: () => import('../views/my/components/opinionSend.vue')
  },
  {
    path: '/loverPerson/:userId',
    component: () => import('../views/my/components/loverPerson.vue')
  },
  {
    path: '/',
    component: () => import('../views/login/login.vue'),
    redirect: '/login'
  }
]

const router = new VueRouter({
  routes
})

export default router
